from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import os


# 模型下载路径
inference_pipeline = pipeline(
    task=Tasks.auto_speech_recognition,
    model='iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch',
    model_revision="v2.0.4",
    model_dir="D:\\code\\models\\pipeline"# 设置模型下载路径
)

rec_result = inference_pipeline('https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_vad_punc_example.wav')
print(rec_result)